#include "T_Ref.h"
#include "T_ReleasePool.h"

void T_Ref::autorelease(){
	T_ReleasePool::getInstance().add(this);
}

int T_Ref::retain(){
	if(m_RefCount>0){
		m_RefCount++;
	}
	return m_RefCount;
}

int T_Ref::release(){
	int count=0;
	if(m_RefCount>0){
		m_RefCount--;
		count=m_RefCount;
		if(0==m_RefCount){
//			T_ReleasePool::getInstance().remove(this);
			delete this;
		}
	}
	return count;
}